<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 400px;
            border: 1px solid blue;
            position: relative;
        }

        .in {
            width: 50px;
            height: 50px;
            background: orangered;
            position: absolute;
            top: 0;
            left: 0;
            animation-name: move;
            animation-duration: 10s;
        }

        @keyframes move {
            0% {
                top: 0;
                left: 0;
            }

            25% {
                top: 0;
                left: 350px;
            }

            50% {
                top: 350px;
                left: 350px;
            }

            75% {
                top: 350px;
                left: 0;
            }

            100% {
                top: 0;
                left: 0;
            }
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="in"></div>
    </div>
</body>

</html>